<template>
  <div class="threeLineProductCode" v-if="variablesObject">
    <div class="flex flex-title">
      <template v-if="variablesObject.icon && variablesObject.icon[0]">
        <img :src="variablesObject.icon[0].url" alt class="icon" />
      </template>
      <p class="title">{{variablesObject.title}}</p>
    </div>
    <div class="t_c">
      <p class="desc">{{variablesObject.desc}}</p>
    </div>

    <div class="flex imgUlrList">
      <router-link
        to=""
        v-for="(item,index) in variablesObject.imgUlrList"
        :key="index"
        class="li"
      >
        <img :src="item.url" alt class="image" />
      </router-link>
    </div>
    <div class="flex tableData">
      <router-link
        to=""
        v-for="(item,index) in variablesObject.tableData"
        :key="index"
        class="li"
      >
        <div class="info t_c">
          <p>{{item.title}}</p>
          <p>{{item.subTitle}}</p>
        </div>
        <img :src="item.imgUrl" alt class="image" />
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "hotProduct",
  components: {},
  props: {
    variablesObject: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {};
  },

  methods: {},

  // 请求商品数据
  mounted() {}
};
</script>
<style lang="scss" scoped>
.threeLineProductCode {
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
  .flex {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .flex-title {
    padding-top: 10px;
    justify-content: center;
  }
  .icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
  }
  p {
    margin: 0;
  }
  .title {
    font-size: 16px;
    color: #333;
  }
  .t_c {
    text-align: center;
  }
  .desc {
    color: #999;
    margin: 5px 0;
    text-align: center;
    display: inline-block;
    position: relative;
    padding: 10px;
    &::before,
    &::after {
      content: " ";
      width: 100%;
      height: 3px;
      position: absolute;
      left: 0;
    }
    &::before {
      top: 0;
      border-bottom: 2px solid #333;
    }
    &::after {
      top: 4px;
      border-bottom: 2px solid #999;
    }
  }
  a {
    height: 140px;
    display: block;
  }
  .image {
    width: 100%;
    height: 100%;
  }

  .imgUlrList {
    .li {
      width: 50%;
      &:last-child {
        margin-left: 10px;
      }
    }
  }
  .tableData {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    border: 1px solid #999;
    .li {
      flex-wrap: wrap;
      padding: 10px 0;
      width: 33.33%;
      min-height: 131px;
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-decoration: none;
      text-align: center;
      position: relative;
      box-sizing: border-box;
      &.libottomBorder{
      border-bottom: 0;
      }
      &:nth-child(3n) {
        border-right: 0;
      }
      
      .info {
        width: 100%;
        p {
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
          color: #424242;
          &:first-child {
            font-size: 16px;
            font-weight: bold;
          }
          &:last-child {
            font-size: 12px;
            color: #8a8a8a;
          }
        }
      }
      p {
        overflow: hidden;
        padding: 0 10px;
      }
      .image {
        width: 60px;
        height: 60px;
        margin: 10px auto 0;
      }
    }
  }
}
</style>



